using System;
using System.Collections.Generic;
using System.IO;
using UnityEngine;


/*
* Introduction：
* Creator：
*/


namespace HyxFrame.Core
{


    /// <summary>
    /// 
    /// </summary>
    public class LoadDllManager : MonoSingleton<LoadDllManager>
    {

        protected override void InitManager()
        {

        }

        public void LoadNewDll(List<string> newDlls, Action callback = null)
        {
            // 加载我的dll
            foreach (var item in newDlls)
            {
                byte[] dllBytes = File.ReadAllBytes($"{Application.streamingAssetsPath}/{item}.bytes");

                System.Reflection.Assembly.Load(dllBytes);
            }
            callback?.Invoke();
        }

    }
}